<table class="table table-responsive" id="returnLogs-table">
    <thead>
        <th>ID</th>
        <th>类型</th>
        <th>Order Id</th>
        <th>收货人</th>
        <th>商品</th>
        <th>属性</th>
        <th>数量</th>
        <th>总金额</th>
        <th>状态</th>
        <th>创建时间</th>
        <th>更新时间</th>
        <th colspan="3">Action</th>
    </thead>
    <tbody>
    @foreach($returnLogs as $returnLog)
        <tr>
            <td>{!! $returnLog->id !!}</td>
            <td>{!! $returnLog->type==1?'订单退款':'单品退款' !!}</td>
            <td>{!! $returnLog->order_id !!}</td>
            <td>{!! $returnLog->order->address->name !!}</td>
            <td>
            @if($returnLog->attribute_id)
                {{ $returnLog->attribute->goods->name }}
                {{ $returnLog->attribute->name }}
            @elseif($returnLog->type==2)
                {{ $returnLog->goods->name }}
            @endif
            </td>
            <td>
                @if($returnLog->attribute_id)
                    {{ $returnLog->attribute->name }}
                @endif
            </td>
            <td>{!! $returnLog->number !!}</td>
            <td>{!! $returnLog->price*$returnLog->number  !!}</td>
            <td>{!! $returnLog->status==1?'申请退款':($returnLog->status==2?'退款成功':'退款失败') !!}</td>
            <td>{!! $returnLog->created_at !!}</td>
            <td>{!! $returnLog->updated_at !!}</td>
            <td>
                <div class='btn-group'>
                    @if($returnLog->status==1)
                    <a href="{!! route('returnLogs.ok', [$returnLog->id]) !!}" onclick="return confirm('确认要同意么')" class='btn btn-default btn-xs'>同意</a>
                    <a href="{!! route('returnLogs.bar', [$returnLog->id]) !!}" onclick="return confirm('确认要拒绝么')" class='btn btn-default btn-xs'>拒绝</a>
                    @endif
                        <a href="{!! route('orders.peisongdan', [$returnLog->order->id]) !!}" target="_blank" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-eye-open"></i></a>
                </div>
            </td>
        </tr>
    @endforeach
    </tbody>
</table>